Matlab相关测刚性平移

用于光测散斑平移

Matlab相关测刚性平移

%读取
Image1 = (imread(‘image_gray.jpg’)); %
Image2 = (imread(‘img_result_8_15.jpg’)); % 带有偏移量的图像,高度向下偏移8,宽度向右偏移15

%显示
subplot(1,2,1);imshow(Image1); title(‘原参考图像’);
subplot(1,2,2);imshow(Image2); title(‘带有偏移量的图像’);

FFT1 = fft2(Image1); % 二维 FFT
FFT2 = conj(fft2(Image2)); %共轭复数

%求复功率谱
FFTR = FFT1.*FFT2; % 复共轭(复功率谱的分子)
magFFTR = abs(FFTR); %sqrt(real^2 + imag^2)取模 (复功率谱的分母)
FFTRN = (FFTR./magFFTR);

%复功率谱的反变换
result = ifft2(double(FFTRN));

M = max(max(result));
[i,j] = find(result == M)

figure; colormap(‘gray’);imagesc(result);
figure; colormap(jet); mesh(result);

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2018-2021 Quincy
  • Visitors: | Views:

请我吃串串呗~

支付宝
微信